home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr48 / pasclern.zip / TYPES.PAS < prev    next >
Pascal/Delphi Source File  |  1993-04-01  |  772b  |  28 lines

  1. PROGRAM example_of_types;
  2.  
  3. TYPE array_def  = ARRAY[12..25] OF INTEGER;
  4.      char_def   = ARRAY[0..27] OF CHAR;
  5.      real_array = ARRAY[-17..42] OF REAL;
  6.      dog_food   = ARRAY[1..6] OF BOOLEAN;
  7.      airplane   = ARRAY[1..12] OF dog_food;
  8.      boat       = ARRAY[1..12,1..6] OF BOOLEAN;
  9.  
  10. VAR index,counter      : INTEGER;
  11.     stuff              : array_def;
  12.     stuff2             : array_def;
  13.     puppies            : airplane;
  14.     kitties            : boat;
  15.  
  16. BEGIN  (* mian program *)
  17.   FOR index := 1 TO 12 DO
  18.     FOR counter := 1 TO 6 DO
  19.     BEGIN
  20.       puppies[index,counter] := TRUE;
  21.       kitties[index,counter] := puppies[index,counter];
  22.     END;
  23.  
  24.   WRITELN(puppies[2,3]:7,kitties[12,5]:7,puppies[1,1]:7);
  25.  
  26. END.  (* of main program *)
  27.  
  28.